#include "StdAfx.h"
#include "PLC.h"

CPLC::CPLC(void)
{
	_pCtrl = NULL;
}

CPLC::~CPLC(void)
{
}

int CPLC::Create(BYTE byID, CSwitchCtrl *pCtrl)
{
	if(!pCtrl)
		return -1;
	_byID = byID;
	_pCtrl = pCtrl;
	return 0;
}

int CPLC::OpenSwitch(int index)
{
	return _pCtrl->OpenSwitch(_byID, index);
}

int CPLC::CloseSwitch(int index)
{
	return _pCtrl->CloseSwitch(_byID, index);
}

int CPLC::Close123()
{
	return _pCtrl->Close123(_byID);
}

int CPLC::CloseAll()
{
	return _pCtrl->CloseAll(_byID);
}